#include<iostream>
#include<string>
#include<vector>
using ll=long long;
using namespace std;

int main(){
    int n;
    cin>>n;
    vector<ll> a(n);
    for(auto& x:a)cin>>x;
    
    int windowsize=10;
    ll sum=0;
    ll ans=0;
    for(int i=0;i<n;i++){
        sum+=a[i];
        ans=max(ans,sum);
    }
    for(int i=windowsize;i<n;i++){
        sum+=a[i]-a[i-windowsize];
        ans=max(ans,sum);
    }
    cout<<ans<<endl;
}
